﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SegGen;

namespace UnitTest
{
    class Program
    {
        static void Main(string[] args)
        {
            int numGenerations = 10;
            double _crossoverFraction = 0.8; 
            double _mutationFraction = 0.05; 
            double _reproductionFraction = 0.7;
            int    _numTopIndividuals = 5;

            String gen;
            gen = //"GAAGCTGCAGTAGAAAAATTCGGTGTAGCTACTGCTGCTGTTGCTGCCGCTGCT";
                //"GAAGCTGCAGTAGAAAAATTCGGTGTAGCT";
                "AAAAAAAAAAAAAAAGGGGGGGGGGGGTTTTTTTTTTTTTTT";
            int numIndividuals = 100;
            int numBoundariesInIndividual = 3;
            int minSegmentSize = 4;
            int numNucleotidesInCodon = 3;
         
            try
            {
                SegGenAlgorithm s = new SegGenAlgorithm(_crossoverFraction, _mutationFraction, _reproductionFraction, _numTopIndividuals, numNucleotidesInCodon);
                s.startSegGen(gen, numGenerations, numIndividuals, numBoundariesInIndividual, minSegmentSize);

            }
            catch(Exception ex)
            {
                System.Console.WriteLine(ex.Message + ex.StackTrace);
            }
                // s.printPopulation();

            //String gen;
            //gen = //"GAAGCTGCAGTAGAAAAATTCGGTGTAGCTACTGCTGCTGTTGCTGCCGCTGCT";
            //    "GAAGCTGCAGTAGAAAAATTCGGTGTAGCT";
            //int numIndividuals = 1;
            //int numBoundariesInIndividual = 3;
            //int minSegmentSize = 2;
            //int numNuclInCodon = 3;
            //Individual i = new Individual(ref gen, numBoundariesInIndividual, minSegmentSize, numNuclInCodon);
            //// Console.WriteLine( "nbcouples = " + i.possibleNumCouplesOfTriplesInSegment(4));
            //// Console.WriteLine("Cx = " + i.InternalCohesion());
            //i.Print();
        }
    }
}
